﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace SmlEngine.Sprites
{
    /// <summary>
    /// Defines a stationary (static) sprite.
    /// </summary>
    public class StaticSprite : SpriteBase
    {
        /// <summary>
        /// The texture of this sprite.
        /// </summary>
        public virtual Texture2D Graphics { get; protected set; }

        internal SpriteEffects Effects { get; set; }
        internal Color Hue { get; set; }
        internal float LayerDepth { get; set; }
        /// <summary>
        /// The ID number of this sprite.
        /// </summary>
        public override int Id { get; set; }

        /// <summary>
        /// Constructs a new StaticSprite instance.
        /// </summary>
        public StaticSprite()
            : this(SpriteEffects.None, Color.White, 1, 0) { }

        internal StaticSprite(SpriteEffects effects, Color hue, float layerDepth, int id)
        {
            Effects = effects;
            Hue = hue;
            LayerDepth = layerDepth;
            Id = Id;
        }

        /// <summary>
        /// Draws this StaticSprite.
        /// </summary>
        /// <param name="spriteBatch">The SpriteBatch to draw onto.</param>
        public virtual void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(Graphics, Bounds.ToRectangle(), null, Hue, 0, Vector2.Zero, Effects, LayerDepth);
        }
    }
}
